package cn.huiyunche.base.service.interfaces;

import cn.huiyunche.base.service.form.BCompanyUserForm;
import cn.huiyunche.base.service.model.SUser;
import cn.huiyunche.base.service.model.SUserExample;
import cn.huiyunche.base.service.query.BCompanyUserQueryConditions;
import cn.huiyunche.base.service.vo.BCompanyUserVo;
import cn.huiyunche.base.service.vo.PageVo;
import org.springframework.validation.BindingResult;

import java.util.List;
import java.util.Map;

/**
 * The interface S user service.
 */
public interface SUserService {

    /**
     * Insert selective int.
     *
     * @param sUser the s user
     * @return the int
     */
    public int insertSelective(SUser sUser);

    /**
     * Delete by primary key int.
     *
     * @param id the id
     * @return the int
     */
    public int deleteByPrimaryKey(Long id);

    /**
     * Select by example list.
     *
     * @param example the example
     * @return the list
     */
    public List<SUser> selectByExample(SUserExample example);

    /**
     * Select by primary key s user.
     *
     * @param id the id
     * @return the s user
     */
    public SUser selectByPrimaryKey(Long id);

    /**
     * Update by primary key selective int.
     *
     * @param record the record
     * @return the int
     */
    public int updateByPrimaryKeySelective(SUser record);

    /**
     * Valid phone exist boolean.
     *
     * @param phone    the phone
     * @param userType the user type
     * @return the boolean
     */
    public boolean validPhoneExist(String phone, Integer userType);

    /**
     * Is disabled boolean.
     *
     * @param id       the id
     * @param phone    the phone
     * @param userType the user type
     * @return the boolean
     */
    boolean isDisabled(Long id, String phone, Integer userType);

    /**
     * Query User By Conditions
     *
     * @param pageVo
     * @param conditions
     * @return
     * @throws Exception
     */
    Map<String, Object> listByCondition(PageVo pageVo, BCompanyUserQueryConditions conditions) throws Exception;

    /**
     * Insert User
     *
     * @param userForm
     * @param bindingResult
     * @return
     * @throws Exception
     */
    Long saveUser(BCompanyUserForm userForm, BindingResult bindingResult) throws Exception;

    /**
     * Query User By id
     *
     * @param id
     * @return
     * @throws Exception
     */
    BCompanyUserVo getById(Long id) throws Exception;

    /**
     * Enable Or Disabled User
     * @param id
     * @param enable
     * @return
     * @throws Exception
     */
    Integer enableOrDisabled(Long id, String enable) throws Exception;
}
